<template>
  <!--  -->
  <div class="mx-container">
    <zz-sub-nav :list="list" :index.sync="index">
      <div class="sub-nav-content">
        <div>
          <div class="details-title">{{ $t("zz.product_presentation") }}</div>
          <zz-card>
            <p slot="content">{{ $t("zz.server.app.intro") }}</p>
            <img
              src="@/assets/img/appSecurity/appSecurity1-1.png"
              slot="img"
              alt=""
              width="320"
            />
          </zz-card>
        </div>
        <!-- 服务特性 -->
        <div>
          <div class="details-title">{{ $t("zz.characteristic_service") }}</div>

          <div class="flex-3">
            <div class="flex-3-item">
              <zz-card position="top" border titleSize="small">
                <span slot="title">{{
                  $t("zz.server.app.characteristic.name1")
                }}</span>
                <p slot="content">
                  {{ $t("zz.server.app.characteristic.intro1") }}
                </p>
                <img
                  src="@/assets/img/appSecurity/appSecurity2-1.png"
                  slot="img"
                  style="width: 54px"
                  alt=""
                />
              </zz-card>
            </div>
            <div class="flex-3-item">
              <zz-card position="top" border titleSize="small">
                <span slot="title">{{
                  $t("zz.server.app.characteristic.name2")
                }}</span>
                <p slot="content">
                  {{ $t("zz.server.app.characteristic.intro2") }}
                </p>
                <img
                  src="@/assets/img/appSecurity/appSecurity2-2.png"
                  slot="img"
                  style="width: 54px"
                  alt=""
                />
              </zz-card>
            </div>
            <div class="flex-3-item">
              <zz-card position="top" border titleSize="small">
                <span slot="title">{{
                  $t("zz.server.app.characteristic.name3")
                }}</span>
                <p slot="content">
                  {{ $t("zz.server.app.characteristic.intro3") }}
                </p>
                <img
                  src="@/assets/img/appSecurity/appSecurity2-3.png"
                  slot="img"
                  style="width: 54px"
                  alt=""
                />
              </zz-card>
            </div>
            <div class="flex-3-item">
              <zz-card position="top" border titleSize="small">
                <span slot="title">{{
                  $t("zz.server.app.characteristic.name4")
                }}</span>
                <p slot="content">
                  {{ $t("zz.server.app.characteristic.intro4") }}
                </p>
                <img
                  src="@/assets/img/appSecurity/appSecurity2-4.png"
                  slot="img"
                  style="width: 54px"
                  alt=""
                />
              </zz-card>
            </div>
            <div class="flex-3-item">
              <zz-card position="top" border titleSize="small">
                <span slot="title">{{
                  $t("zz.server.app.characteristic.name5")
                }}</span>
                <p slot="content">
                  {{ $t("zz.server.app.characteristic.intro5") }}
                </p>
                <img
                  src="@/assets/img/appSecurity/appSecurity2-5.png"
                  slot="img"
                  style="width: 54px"
                  alt=""
                />
              </zz-card>
            </div>
            <div class="flex-3-item">
              <zz-card position="top" border titleSize="small">
                <span slot="title">{{
                  $t("zz.server.app.characteristic.name6")
                }}</span>
                <p slot="content">
                  {{ $t("zz.server.app.characteristic.intro6") }}
                </p>
                <img
                  src="@/assets/img/appSecurity/appSecurity2-6.png"
                  slot="img"
                  style="width: 54px"
                  alt=""
                />
              </zz-card>
            </div>
            <div class="flex-3-item">
              <zz-card position="top" border titleSize="small">
                <span slot="title">{{
                  $t("zz.server.app.characteristic.name7")
                }}</span>
                <p slot="content">
                  {{ $t("zz.server.app.characteristic.intro7") }}
                </p>
                <img
                  src="@/assets/img/appSecurity/appSecurity2-7.png"
                  slot="img"
                  style="width: 54px"
                  alt=""
                />
              </zz-card>
            </div>
            <div class="flex-3-item">
              <zz-card position="top" border titleSize="small">
                <span slot="title">{{
                  $t("zz.server.app.characteristic.name8")
                }}</span>
                <p slot="content">
                  {{ $t("zz.server.app.characteristic.intro8") }}
                </p>
                <img
                  src="@/assets/img/appSecurity/appSecurity2-8.png"
                  slot="img"
                  style="width: 54px"
                  alt=""
                />
              </zz-card>
            </div>
          </div>
        </div>
        <div class="content-sub-nav-wrap">
          <div class="details-title">{{ $t("zz.application_scenarios") }}</div>
          <div class="header-nav-wrapper-wrap">
            <ul class="header-nav-wrapper" style="width: 500px">
              <li
                v-for="(item, i) in list[2].child"
                :key="i"
                :class="item.index == subIndex ? 'active' : ''"
                @click="navClick(item)"
              >
                {{ item.name }}
              </li>
            </ul>
          </div>
          <!--  -->
          <div v-if="subIndex == 1">
            <img :src="$t('zz.img.appSecurity3-1')" alt="" />
            <h6 class="list-title">{{ $t("zz.business_value") }}</h6>
            <ul class="list-has-poi">
              <li>{{ $t("zz.server.app.business_value.name1") }}</li>
              <li>{{ $t("zz.server.app.business_value.name2") }}</li>
              <li>{{ $t("zz.server.app.business_value.name3") }}</li>
            </ul>
          </div>
          <div v-if="subIndex == 2">
            <img :src="$t('zz.img.appSecurity3-2')" alt="" />
            <h6 class="list-title">{{ $t("zz.business_value") }}</h6>
            <ul class="list-has-poi">
              <li>{{ $t("zz.server.app.business_value.name4") }}</li>
              <li>{{ $t("zz.server.app.business_value.name5") }}</li>
              <li>{{ $t("zz.server.app.business_value.name6") }}</li>
            </ul>
          </div>
          <div v-if="subIndex == 3">
            <img :src="$t('zz.img.appSecurity3-3')" alt="" />
            <h6 class="list-title">{{ $t("zz.business_value") }}</h6>
            <ul class="list-has-poi">
              <li>{{ $t("zz.server.app.business_value.name7") }}</li>
              <li>{{ $t("zz.server.app.business_value.name8") }}</li>
            </ul>
          </div>
          <div v-if="subIndex == 4">
            <img :src="$t('zz.img.appSecurity3-4')" alt="" />
            <h6 class="list-title">{{ $t("zz.business_value") }}</h6>
            <ul class="list-has-poi">
              <li>{{ $t("zz.server.app.business_value.name9") }}</li>
              <li>{{ $t("zz.server.app.business_value.name10") }}</li>
            </ul>
          </div>
          <div v-if="subIndex == 5">
            <img :src="$t('zz.img.appSecurity3-5')" alt="" />
            <h6 class="list-title">{{ $t("zz.business_value") }}</h6>
            <ul class="list-has-poi">
              <li>{{ $t("zz.server.app.business_value.name11") }}</li>
              <li>{{ $t("zz.server.app.business_value.name12") }}</li>
            </ul>
          </div>
        </div>
        <div class="content-sub-nav-wrap">
          <div class="details-title">{{ $t("zz.access_scenario") }}</div>
          <div class="header-nav-wrapper-wrap">
            <ul class="header-nav-wrapper">
              <li
                v-for="(item, i) in list[3].child"
                :key="i"
                :class="item.index == subIndex1 ? 'active' : ''"
                @click="navClick1(item)"
              >
                {{ item.name }}
              </li>
            </ul>
          </div>
          <!--  -->
          <div v-if="subIndex1 == 1">
            <img :src="$t('zz.img.appSecurity4-1')" alt="" />
            <div style="height: 20px"></div>
            <p>{{ $t("zz.server.app.business_value.name13") }}</p>
          </div>
          <div v-if="subIndex1 == 2">
            <img :src="$t('zz.img.appSecurity4-2')" alt="" />
            <div style="height: 20px"></div>
            <p>{{ $t("zz.server.app.business_value.name14") }}</p>
          </div>
        </div>
      </div>
    </zz-sub-nav>
  </div>
</template>

<script>
import SubNav from "@/components/SubNav/index.vue";
import ZzCard from "@/components/ZzCard";
import { mapGetters } from "vuex";

export default {
  data() {
    return {
      index: 1,
      subIndex: 1,
      subIndex1: 1,
      height: 230,
      titleSize: 20,
    };
  },

  components: {
    "zz-sub-nav": SubNav,
    ZzCard,
  },
  props: {},
  mounted() {},
  computed: {
    activeItem: function () {
      let activeItem = this.list.find((v) => v.index == this.index);
      console.log(this.list[this.index]);
      this.subIndex = activeItem.child ? activeItem.child[0].index : 1;
      return activeItem;
    },
    ...mapGetters({
      isPC: "isPC",
    }),
    list: function () {
      return [
        {
          name: this.$t("zz.product_presentation"),
          index: 1,
          title: this.$t("zz.product_presentation"),
        },
        { name: this.$t("zz.characteristic_service"), index: 2 },
        {
          name: this.$t("zz.application_scenarios"),
          index: 3,
          child: [
            { name: this.$t("zz.server.app.application.subMenu1"), index: 1 },
            { name: this.$t("zz.server.app.application.subMenu2"), index: 2 },
            { name: this.$t("zz.server.app.application.subMenu3"), index: 3 },
            { name: this.$t("zz.server.app.application.subMenu4"), index: 4 },
            { name: this.$t("zz.server.app.application.subMenu5"), index: 5 },
          ],
        },
        {
          name: this.$t("zz.access_scenario"),
          index: 4,
          child: [
            {
              name: this.$t("zz.server.app.access_scenario.subMenu1"),
              index: 1,
            },
            {
              name: this.$t("zz.server.app.access_scenario.subMenu2"),
              index: 2,
            },
          ],
        },
      ];
    },
  },
  watch: {},
  methods: {
    navClick(a_item) {
      this.subIndex = a_item.index;
    },
    navClick1(a_item) {
      console.log(a_item);
      this.subIndex1 = a_item.index;
    },
  },
  destroyed() {},
};
</script>
<style lang='scss' scoped>
@import "@/style/variables.scss";

.sub-nav-content {
  padding: 12px 48px;
  flex: 1;
  width: 100%;
  .pro-title {
    color: $color;
    font-size: 20px;
    padding: 20px 45px;
    border-bottom: 1px solid $border;
  }
  .pro-intro-wrap {
    padding: 30px 48px;
  }
  img {
  }
  & > ul {
    width: auto;
    margin: 0 auto;
  }
}
.son-pro-wrap {
  display: flex;
  // justify-content: space-between;
  margin-top: 48px;
  flex-wrap: wrap;
  & > div {
    width: 240px;
    margin-right: 40px;
  }
}
.pro-pailie-wrap {
  .card-wrap {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    & > div {
      width: 40%;
      margin: 0 5% 30px;
      img {
        margin-top: 0;
        width: 32px;
        margin-right: 10px;
      }
      h6 {
        font-size: 22px;
        line-height: 32px;
        margin: 15px 0 20px;
      }
      p {
        font-size: 14px;
        line-height: 25px;
      }
    }
  }
}
.business-wrap {
  padding: 50px 0;
  h6 {
    font-size: 16px;
    margin: 50px 0 25px;
  }
  ul {
    padding-left: 25px;
    li {
      color: rgba(59, 59, 59, 1);
      font-size: 14px;
      line-height: 200%;
    }
  }
  p {
    font-size: 14px;
  }
}
.list-has-poi {
  list-style-type: disc;
  li {
    list-style-type: disc;
  }
}
</style>